package com.czmh.etc.onlinepubsys.controller;


import com.alibaba.fastjson.JSON;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.czmh.etc.onlinepubsys.json.cmg.JSONResult;
import com.czmh.etc.onlinepubsys.model.CmsContentCategory;
import com.czmh.etc.onlinepubsys.services.CmsContentCategoryService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * <p>
 * 资讯分类表 前端控制器
 * </p>
 *
 * @author eric
 * @since 2021-06-07
 */
@Api(tags = "资讯分类管理-公告", description = "资讯分类管理")
@RestController
@RequestMapping("/cms/cmsContentCategory")
public class CmsContentCategoryController {
    @Autowired
    CmsContentCategoryService cmsContentCategoryService;

    @ApiOperation("获取资讯分类列表")
    @RequestMapping(value = "/queryList", method = RequestMethod.GET)
    @ResponseBody
    public JSONResult queryList(@RequestParam(value = "pageSize", defaultValue = "10") Integer pageSize,
                                @RequestParam(value = "pageNum", defaultValue = "1") Integer pageNum) {
        JSONResult result = new JSONResult();
        IPage<CmsContentCategory> cmsContentCategories = cmsContentCategoryService.queryList(pageSize, pageNum);
        result.setRspData(JSON.toJSONString(cmsContentCategories));
        return result;
    }

}

